package com.portal.innovation.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.portal.innovation.dao.EnrollmentInfoDao;
import com.portal.innovation.dao.TagsDao;
import com.portal.innovation.pojo.Tags;
import com.portal.innovation.service.TagsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service("tagsService")
public class TagsServiceImpl extends ServiceImpl<TagsDao, Tags> implements TagsService {

    @Autowired
    private EnrollmentInfoDao enrollmentInfoDao;

    @Override
    @Transactional
    public void removeTagByIds(List<Integer> ids) {
        for (Integer id : ids) {
            //移除报名学生中的 tag 信息
            enrollmentInfoDao.removeTagId(id);
        }
        removeByIds(ids);
    }
}